<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8" />
<title>财务管理 - 查看提现信息</title>
<?php include($this->c['_homes']['_viewsHome'].'/_global/_head.php');?>
<link rel="stylesheet" type="text/css" href="/style/assets/plugins/bootstrap-datetimepicker/css/datetimepicker.css" />
</head>
<!-- BEGIN BODY -->
<body class="page-header-fixed page-sidebar-fixed">
<!-- BEGIN HEADER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/head.php');?>
<!-- END HEADER -->
<div class="clearfix"></div>
<!-- BEGIN CONTAINER -->
<div class="page-container" > 
  <!-- BEGIN HORIZONTAL MENU PAGE SIDEBAR1 -->
  <?php include($this->c['_homes']['_viewsHome'].'/_global/menu.php');?>
  <!-- END BEGIN HORIZONTAL MENU PAGE SIDEBAR --> 
  <!-- BEGIN PAGE -->
  <div class="page-content"> 
    <!-- BEGIN PAGE HEADER-->
    <div class="row">
      <div class="col-md-12"> 
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title"> 查看提现信息 </h3>
        <ul class="page-breadcrumb breadcrumb">
          <li> <i class="icon-home"></i> <a href="/manage">后台</a> <i class="icon-angle-right"></i> </li>
          <li> 财务管理 <i class="icon-angle-right"></i> </li>
          <li> <a href="/finance/withdraw">提现管理</a> <i class="icon-angle-right"></i> </li>
          <li>查看提现信息</li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB--> 
      </div>
    </div>
    <!-- END PAGE HEADER--> 
    <!-- BEGIN PAGE CONTENT-->
    
    <div class="row">
      <div class="col-md-12"> 
        <!-- BEGIN SAMPLE FORM PORTLET-->
        <form class="form-horizontal" id="_frm" method="post" action="/finance/savewithdraw" onSubmit="return chkfrm();">
          <input type="hidden" name="act" id="_act" value="">
          <input type="hidden" name="coin_type"  value="<?=$this->data['coin_type']?>">
          <input type="hidden" name="id" value="<?=$this->data['id'];?>">
          <input type="hidden" name="ref" value="<?=$_SERVER['HTTP_REFERER'];?>">
          <div class="tabbable tabbable-custom boxless">
          <div class="tab-content"> 
            <!--Tab0-->
            <div class="tab-pane active" id="tab_0">
              <div class="portlet box blue ">
                <div class="portlet-title">
                  <div class="caption"> <i class="icon-reorder"></i> 基本信息 </div>
                </div>
                <div class="portlet-body form">    
                  <div class="form-body">              
                    <div class="form-group">
                      <label  class="col-md-2 control-label">流水号</label>
                      <div class="col-md-9">
                        <h5>
                          <?=$this->data['id'];?>
                        </h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">用户昵称</label>
                      <div class="col-md-9">
                        <h5>
                          <?=$this->data['userinfo']['realname']?>
                        </h5>
                      </div>
                    </div>
              
                    <div class="form-group">
                      <label  class="col-md-2 control-label">申请时间</label>
                      <div class="col-md-9">
                        <h5>
                          <?=date("Y-m-d H:i:s",$this->data['create_time']);?>
                        </h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">提现类型</label>
                      <div class="col-md-9">
                        <h5>
                         <?=$this->c['stat']['withdraw_type'][$this->data['withdraw_type']];?>
                        </h5>
                      </div>
                    </div>
                    <hr>
                      <div class="form-group">
                      <label  class="col-md-2 control-label">申请提现币种</label>
                      <div class="col-md-9">
                        <h5>
                          <?=$this->c['stat']['coin_type'][$this->data['coin_type']];?>
                        </h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">申请金额</label>
                      <div class="col-md-9">
                        <h5>￥
                          <?=number_format($this->data['charge_fee'] + $this->data['money'],2,".","");?>
                        </h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">需付款金额</label>
                      <div class="col-md-9">
                        <h4 style="color: #f00;">￥
                          <?=$this->data['money'];?>（请按此金额给用户转账付款）
                        </h4>
                      </div>
                    </div>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">手续费</label>
                      <div class="col-md-9">
                        <h5>￥
                          <?=$this->data['charge_fee'];?>
                        </h5>
                      </div>
                    </div>
                    <?php
                    if($this->data['withdraw_type']==2){
                      ?>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">收款人</label>
                      <div class="col-md-9">
                        <h5>
                          <?=$this->data['realname'];?>
                        </h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">收款人电话</label>
                      <div class="col-md-9">
                        <h5>
                          <?=$this->data['mobile'];?>
                        </h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">开户行</label>
                      <div class="col-md-9">
                        <h5>
                          <?=$this->data['bank_sn'];?>
                        </h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">银行账号</label>
                      <div class="col-md-9">
                        <h5>
                          <?=$this->data['bank_account'];?>
                        </h5>                        
                      </div>
                    </div>
                    <?php }else{
                      ?>
                      <hr>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">公众号APPID</label>
                      <div class="col-md-9">
                        <h5>
                          <?=$this->appid;?>
                        </h5>
                      </div>
                    </div>
                   <div class="form-group">
                      <label  class="col-md-2 control-label">收款用户OpenID</label>
                      <div class="col-md-9">
                        <h5>
                          <?=$this->data['openid'];?>
                        </h5>
                      </div>
                    </div>
                   <div class="form-group">
                      <label  class="col-md-2 control-label">收款用户真实姓名</label>
                      <div class="col-md-9">
                        <h5>
                          <?= $this->data['userinfo']['name'];?>
                        </h5>
                      </div>
                    </div>
                    <hr>
                    <?
                    }
                    ?>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">状态</label>
                      <div class="col-md-9">
                        <h5>
                          <?=$this->c['stat']['withdraw'][ $this->data['stat'] ];?>
                        </h5>
                      </div>
                    </div>
                    
           
                    <? if($this->data['stat']==2){?>
                    <hr>
                    <div class="form-group">
                      <label class="col-md-2 control-label">转账流水号</label>
                      <div class="col-md-6">
                        <h5><?=$this->data['trade_no'];?></h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-md-2 control-label">手续费</label>
                      <div class="col-md-6">
                        <h5><?=$this->data['trade_fee'];?></h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-md-2 control-label">转账时间</label>
                      <div class="col-md-6">
                        <h5><?=date("Y-m-d H:i:s",$this->data['trade_time']);?></h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-md-2 control-label">备注信息</label>
                      <div class="col-md-6">
                        <h5><?=$this->data['trade_note'];?></h5>
                      </div>
                    </div>
                    <?
          					}
          					?>
                  </div>
                </div>
              </div>
            </div>  
            
            <?php
    			if($this->pv['execute'] && $this->data['stat']<2 ){
    			?>         
            <!--Tab2-->
            <div class="tab-pane active" id="tab_2">
              <div class="portlet box blue ">
                <div class="portlet-title">
                  <div class="caption"> <i class="icon-reorder"></i> 提现操作</div>
                </div>
              
                <div class="portlet-body form">
                  <div class="form-body">
                 
                    <div class="form-group">
                      <label class="col-md-2 control-label">转账流水号</label>
                      <div class="col-md-6">
                        <input type="text" name="trade_no" id="_trade_no" maxlength="30" class="form-control" value="">
                        <span class="help-block">请填写转账结果的流水号</span> </div>
                    </div>
                    <div class="form-group">
                      <label class="col-md-2 control-label">手续费</label>
                      <div class="col-md-6">
                        <input type="text" name="trade_fee" value="0" id="_trade_fee" maxlength="30" class="form-control">
                        <span class="help-block">请填写转账花费的手续费金额</span> </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-md-2">转账时间</label>
                        <div class="col-md-6">
                          <div class="input-group date form_datetime" data-date="<?=date("Y-m-d\TH:i:s\Z");?>">
                            <input type="text" size="16" name="trade_time" id="_trade_time" readonly class="form-control">
                            <span class="input-group-btn">
                            <button class="btn default date-reset" type="button"><i class="icon-remove"></i></button>
                            </span> <span class="input-group-btn">
                            <button class="btn default date-set" type="button"><i class="icon-calendar"></i></button>
                            </span> </div>
                          <!-- /input-group --> 
                        </div>
                      </div>
                    <div class="form-group">
                      <label class="col-md-2 control-label">备注信息</label>
                      <div class="col-md-6">
                        <textarea name="trade_note" id="_trade_note" class="form-control" rows="3" placeholder="请填写转账使用的银行或第三方平台信息，例如：使用支付宝转账200元，手续费2元"></textarea>
                      </div>
                    </div>
                    <hr>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">可执行操作</label>
                      <div class="col-md-9">
                      	<button class="btn blue" onClick="_set_act('process');">处理中</button>
                        <button class="btn green" onClick="_set_act('done');">完成提现</button>
                        <button class="btn red" onClick="_set_act('cancel');">提现失败</button>
                      </div>
                    </div> 
                    
                   
                  </div>
                </div>
              </div>
              <!--End Tab--> 
            
            </div>
          <?
            }
            ?>
          </div>
        </form>
        <!-- END SAMPLE FORM PORTLET--> 
      </div>
    </div>
    <!-- END PAGE CONTENT--> 
  </div>
  <!-- END PAGE --> 
</div>
<!-- END CONTAINER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/_footer.php');?>
<script type="text/javascript" src="/style/assets/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script> 
<script type="text/javascript" src="/style/assets/plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script> 
<script>
var handleDatetimePicker = function () {
	$(".form_datetime").datetimepicker({
		language:'zh-CN',
		autoclose: true,
		format: "yyyy-mm-dd hh:ii"
	});	
	$('body').removeClass("modal-open"); // fix bug when inline picker is used in modal
}

jQuery(document).ready(function() {    
   App.init();
	
   handleDatetimePicker();
	
});

function _set_act(act)
{
	$("#_act").prop("value",act);
	
}

function chkfrm()
{
	var _act = $("#_act").prop("value"),cm = false;
	
	switch(_act){
		case "done":			
			if( $("#_trade_no").prop("value")==""){
				alert("请填写转账流水号");
				$("#_trade_no").focus();
				return false;	
			}
			
			if( $("#_trade_fee").prop("value")==""){
				alert("请填写手续费");
				$("#_trade_fee").focus();
				return false;	
			}
			
			if( $("#_trade_time").prop("value")==""){
				alert("请选择转账时间");
				$("#_trade_time").focus();
				return false;	
			}
			
		/* 	if( $("#_trade_note").val()==""){
				alert("请填写转账备注信息");
				$("#_trade_note").focus();
				return false;	
			} */
			
			cm = confirm("确定提现成功？");
			break;		
		case "cancel":
			cm = confirm("确定设为提现失败？");
			break;
		case "process":
			cm = confirm("确定设为正在处理中？");
			break;
		
	}
	
	if(!cm) return false;
}
</script> 
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>